import fetch from 'utils/fetch';

//查询所有省
export function queryAllProvince() {
    const data = {};
    return fetch({
        url: 'school/listProvince',
        method: 'post',
        data
    });
}
//查询所有市
export function queryAllCityByProvinceId(provinceId) {
    const data = {
        provinceId
    };
    return fetch({
        url: 'school/listCity',
        method: 'post',
        data
    });
}
//查询所有区
export function queryAllAreaByCityId(cityId) {
    const data = {
        cityId
    };
    return fetch({
        url: 'school/listArea',
        method: 'post',
        data
    });
}

//根据名称模糊查询学校名称
export function listSchoolByName(schoolName,provinceId,cityId,areaId) {
    const data = {
      schoolName,
      provinceId,
      cityId,
      areaId
    };
    return fetch({
        url: 'school/listSchoolByName',
        method: 'post',
        data
    });
  }

  //根据名称模糊查询父校名称
export function listParentSchoolByName(schoolName,schoolId) {
    const data = {
      schoolName,
      schoolId
    };
    return fetch({
        url: 'school/listParentSchoolByName',
        method: 'post',
        data
    });
  }
//根据名称模糊查询科目
export function listSubject(subjectName) {
    const data = {
        subjectName
    };
    return fetch({
        url: 'school/listSubject',
        method: 'post',
        data
    });
  } 

//查询所有省
export function getAllProvince() {
    const params = {
    };
    return fetch({
        url: 'sysArea/queryAllProvince',
        method: 'get',
        params
    });
}
//查询所有市
export function getAllCityByProvinceId(provinceId) {
    const params = {
        provinceId 
    };
    return fetch({
        url: 'sysArea/queryAllCityByProvinceId',
        method: 'get',
        params
    });
}


// 12. 班级接口
export function listClassInfoBySchoolId(schoolId) {
    const data = {
        schoolId
    }
    return fetch({
        url: `/serviceOrder/listClassInfoBySchoolId/${schoolId}`,
        method: 'post',
        data
    });
}

// 代理商下的报表模块的  根据学校查班级接口
export function listClassBySchoolId(schoolId) {
    const data = {
        schoolId
    }
    return fetch({
        url: `/report/getClassBySchool`,
        method: 'post',
        data
    });
}

